<div class="form">

<?php $form=$this->beginWidget('CActiveForm', array(
	'id'=>'alocacao-form',
	'enableAjaxValidation'=>false,
)); ?>

	<p class="note">Campos com <span class="required">*</span> são obrigatórios.</p>

	<?php echo $form->errorSummary($model); ?>

        <!--
            <?php echo $form->textField($model,'DT_DIA'); ?>
            <?php echo $form->textField($model,'HR_INI'); ?>
            <?php echo $form->textField($model,'HR_FIM'); ?>
        -->
        
        <div class="row">
            <?php echo $form->labelEx($modelP,'TX_DESCRICAO'); ?>
            <?php echo $form->textField($modelP, 'TX_DESCRICAO', array('readonly'=>'true')); ?>
            <?php echo $form->error($modelP,'TX_DESCRICAO'); ?>
            
        </div>
        
	<div class="row">
            <?php echo $form->labelEx($modelA,'TX_NOME'); ?>
            <?php echo $form->textField($modelA,'TX_NOME', array('readonly'=>'true')); ?>
            <?php echo $form->error($modelA,'TX_NOME'); ?>
            <?php echo $form->hiddenField($model,'ID_AMBIENTE', array('value'=>$modelA->ID_AMBIENTE)); ?>
	</div>
        
	<div class="row">
            <?php echo $form->labelEx($model,'DT_DIA'); ?>
            <?php echo $form->textField($model,'DT_DIA', array('readonly'=>'true')); ?>
            <?php echo $form->error($model,'DT_DIA'); ?>
	</div>

	<div class="row">
            <?php echo $form->labelEx($model,'HR_INI'); ?>
            <?php echo $form->textField($model,'HR_INI', array('readonly'=>'true')); ?>
            <?php echo $form->error($model,'HR_INI'); ?>
	</div>

	<div class="row">
            <?php echo $form->labelEx($model,'HR_FIM'); ?>
            <?php echo $form->textField($model,'HR_FIM', array('readonly'=>'true')); ?>
            <?php echo $form->error($model,'HR_FIM'); ?>
	</div>

	<div class="row">
            <?php echo $form->labelEx($model,'ID_USO'); ?>
            <?php
                $dados = $modelAU->getUsos();
                echo $form->dropDownList($model,'ID_USO', $dados); 
            ?>
            <?php echo $form->error($model,'ID_USO'); ?>
	</div>

	<div class="row">
            <?php echo $form->hiddenField($model,'ID_USUARIO', array('value'=>Yii::app()->user->getState("identity")->getId())); ?>
	</div>

	<div class="row">
            <?php
                if (Yii::app()->user->getState("identity")->isAdmin()){
                    echo $form->labelEx($model,'TX_INTERESSADO');
                    echo $form->textField($model,'TX_INTERESSADO',array('size'=>60,'maxlength'=>80));
                    echo $form->error($model,'TX_INTERESSADO');
                }else{
                    $usu = $modelU->findByAttributes(array('ID_USUARIO'=>Yii::app()->user->getState("identity")->getId()));
                    echo $form->hiddenField($model,'TX_INTERESSADO', array('value'=>$usu->TX_NOME));
                }
            ?>
	</div>

	<div class="row">
            <?php echo $form->labelEx($model,'TX_DESCRICAO'); ?>
            <?php echo $form->textField($model,'TX_DESCRICAO',array('size'=>60,'maxlength'=>255)); ?>
            <a href="<?php echo Yii::app()->createAbsoluteUrl('disciplina/popupRadio').'&KeepThis=true&TB_iframe=true&height=500&width=500'?>" title="Adicionar Disciplina"
               class="thickbox"
               >
                <img src="<?php echo Yii::app()->request->baseUrl.'/images/clip.png'?>"/>
            </a>
            <?php echo $form->error($model,'TX_DESCRICAO'); ?>
	</div>

	<div class="row buttons">
            <?php echo CHtml::submitButton($model->isNewRecord ? 'Criar' : 'Salvar'); ?>
	</div>

<?php $this->endWidget(); ?>

</div><!-- form -->